package com.salt.modules.sys.web;

import com.salt.common.json.AjaxJson;
import com.salt.core.web.BaseController;
import com.salt.modules.sys.service.CompanyService;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Description
 * @Author salt
 * @Date 2022/9/13
 * @Version 1.0.1
 */
@RestController
@AllArgsConstructor
@RequestMapping("sys/company")
public class CompanyController extends BaseController {

    private final CompanyService companyService;

    @GetMapping("get")
    public AjaxJson getCompanyInfo() {
        return AjaxJson.success().put("company", companyService.getCompanyInfo());
    }

    @GetMapping("find")
    public AjaxJson find(@RequestParam("name") String name) {
        return companyService.findInfo(name);
    }


    /*@GetMapping("get")
    public AjaxJson get(String name) {
        String info = companyService.getInfo(name);
        return AjaxJson.success().put("info", info);
    }

    @GetMapping("search")
    public AjaxJson search() {
        String info = companyService.search();
        return AjaxJson.success().put("info", info);
    }*/

}
